package com.yc.fav.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yc.fav.entity.Fav;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author LiaoYan
 * @since 2025-08-16
 */
public interface FavMapper extends BaseMapper<Fav> {

    @Select("select * from fav a where \n" +
            " exists (select * from tag_fav b where a.id=b.fid" +
            " and tid=#{tid})" +
            " and a.uid=#{uid}")
    List<Fav> queryByTidAndUid(@Param("tid") int tid, @Param("uid")int uid);

}
